package javase.spring;


import javafx.application.Application;
import javase.spring.annotation.ComponentScan;
import javase.spring.classes.controller.HelloController;
import javase.spring.parser.ApplicationContext;
import javase.spring.parser.ComponentScanParser;

import java.nio.file.AccessMode;


@ComponentScan("javase")
public class RunApp {
    public static void main(String[] args) throws Exception {
        Class clazz= RunApp.class;
        ComponentScan componentScan =
                (ComponentScan) clazz.getAnnotation(ComponentScan.class);
        if (componentScan!=null) {
            String packName = componentScan.value();
            ApplicationContext applicationContext=
                    new ComponentScanParser() ;
            applicationContext.config(packName);

            HelloController helloController=
                    applicationContext.getBean("helloController");
           helloController.helloController();




        }


    }

}
